package com.mediacloud.app.newsmodule.fragment.baoliao.api;

import android.content.Context;
import android.text.TextUtils;
import android.util.Log;

import com.google.gson.JsonObject;
import com.hebeimodule.bean.HeBeiLiveDetail;
import com.hebeimodule.bean.HeBeiLiveImageTextListData;
import com.hebeimodule.bean.HeartCheckData;
import com.hebeimodule.bean.LiveAD;
import com.hebeimodule.bean.LiveDressDetail;
import com.hebeimodule.bean.LiveHistory;
import com.hebeimodule.bean.LiveStatistics;
import com.hebeimodule.bean.LiveUserInfo;
import com.hebeimodule.bean.MircoLiveSeat;
import com.hebeimodule.socket.mod.MSG_Comment;
import com.mediacloud.app.message.ContributeDetail;
import com.mediacloud.app.message.MessageStatementBean;import com.mediacloud.app.message.MyMsgCollectBean;
import com.mediacloud.app.message.MessageTypeItem;
import com.mediacloud.app.model.news.NewBaoLiaoCountModel;
import com.mediacloud.app.model.news.NewBaoLiaoListModel;
import com.mediacloud.app.newsmodule.adaptor.component.WikiRankList;
import com.mediacloud.app.newsmodule.drama.AnchorHeatRankList;
import com.mediacloud.app.newsmodule.drama.CommunityReporterList;
import com.mediacloud.app.newsmodule.drama.DramaListResponse;
import com.mediacloud.app.newsmodule.drama.MilitarySelections;
import com.mediacloud.app.newsmodule.drama.PopularRecommendBean;
import com.mediacloud.app.newsmodule.drama.RadioRankFindList;
import com.mediacloud.app.newsmodule.fragment.baoliao.model.DramaDetailResponse;
import com.mediacloud.app.newsmodule.fragment.baoliao.model.add.BaseBeen;
import com.mediacloud.app.newsmodule.fragment.baoliao.model.add.SubmitRevelationReturnData;
import com.mediacloud.app.newsmodule.fragment.baoliao.model.polotics.PoliticsSubmitImageReturnData;
import com.mediacloud.app.newsmodule.fragment.ebook.EbookData;
import com.mediacloud.app.newsmodule.fragment.recommend.ProgramNew;
import com.mediacloud.app.newsmodule.fragment.simulcast.CCTVLiveStatus;
import com.mediacloud.app.newsmodule.fragment.simulcast.DateBean;
import com.mediacloud.app.newsmodule.fragment.simulcast.SimulcastBean;
import com.mediacloud.app.newsmodule.fragment.simulcast.TodayCCTVNews;
import com.mediacloud.app.newsmodule.fragment.video.vod.CategoryData;
import com.mediacloud.app.newsmodule.fragment.video.vod.MovieCategoryDataBean;
import com.mediacloud.app.newsmodule.fragment.works.ArticleBean;
import com.mediacloud.app.newsmodule.model.MediaListBean;
import com.mediacloud.app.newsmodule.model.SearchTiktokData;
import com.mediacloud.app.quanzi.model.ActivationRankingBean;
import com.mediacloud.app.quanzi.model.AddBookReadBean;
import com.mediacloud.app.quanzi.model.BaseDataBean;
import com.mediacloud.app.quanzi.model.BaseDataListBean;
import com.mediacloud.app.quanzi.model.DongTaiBean;
import com.mediacloud.app.quanzi.model.HuaTiBean;
import com.mediacloud.app.quanzi.model.LiveAuditMod;
import com.mediacloud.app.quanzi.model.PlaygroundGatherBean;
import com.mediacloud.app.quanzi.model.PraiseUserInfo;
import com.mediacloud.app.quanzi.model.UploadImageData;
import com.mediacloud.app.quanzi.model.UserHomeHuiFu;
import com.mediacloud.app.reslib.enums.AppFactoryGlobalConfig;
import com.mediacloud.app.reslib.util.HTTPClient;
import com.mediacloud.app.user.net.JSONObjectConvertFactory;
import com.mediacloud.app.user.net.SSLSocketClient;
import com.mediacloud.app.user.net.SignInterceptor;
import com.mediaclound.appfactnet.utils.GETBadInterceptor;
import com.mediacloud.app.util.ProxyUtil;
import com.model.EbookMode;
import com.tencent.liteav.demo.superplayer.model.entity.AlbumDetail;
import com.tencent.liteav.demo.superplayer.model.entity.AlbumRecommend;
import com.tencent.liteav.demo.superplayer.model.entity.DramaMainBeanNew;
import com.tencent.liteav.demo.superplayer.model.entity.PublishArticlePage;
import com.tencent.liteav.demo.superplayer.model.entity.VideoAlbumNew;

import org.json.JSONObject;

import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import javax.net.ssl.X509TrustManager;

import io.reactivex.Observable;
import okhttp3.MultipartBody;
import okhttp3.OkHttpClient;
import okhttp3.Protocol;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.logging.HttpLoggingInterceptor;
import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.adapter.rxjava2.RxJava2CallAdapterFactory;
import retrofit2.converter.gson.GsonConverterFactory;
import retrofit2.http.Body;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.GET;
import retrofit2.http.Header;
import retrofit2.http.Headers;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import retrofit2.http.QueryMap;

/**
 * @author TXL
 * description :
 */
public class SpiderCmsApi {

    private static volatile ISpiderCmsApi spiderCmsApi;
    private static volatile ISpiderCmsApi spiderCmsApiJson;

    //spiderServer对应AppFactoryGlobalConfig.getAppServerConfigInfo(context).spider
    private static volatile ISpiderCmsApi spiderServerApi;

    public static ISpiderCmsApi getSpiderServerApi(Context context) {
        if (spiderServerApi == null) {
            synchronized (SpiderCmsApi.class) {
                if (spiderServerApi == null) {
                    initSpiderServerApi(context.getApplicationContext());
                }
            }
        }
        return spiderServerApi;
    }

    private static void initSpiderServerApi(Context context) {
        String baseUrl = AppFactoryGlobalConfig.getAppServerConfigInfo(context).spider;
        if (TextUtils.isEmpty(baseUrl)) {
            Log.e("DataInvokeUtil", "initSpiderCmsApi failed spider_cms is null");
            Log.e("DataInvokeUtil", "initSpiderServerApi failed spider_cms is null");
            return;
        }
        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        builder.dns(new MyDns());
        ProxyUtil.config(builder);
        builder.protocols(Collections.unmodifiableList(Arrays.asList(Protocol.HTTP_1_1, Protocol.HTTP_2)));
        builder.addInterceptor(new SignInterceptor());
        builder.addInterceptor(new GETBadInterceptor(AppFactoryGlobalConfig.getAppServerConfigInfo(context).spider, AppFactoryGlobalConfig.getAppServerConfigInfo(context).cdn_spider));
        builder.addInterceptor(interceptor);
        builder.sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), (X509TrustManager) SSLSocketClient.getTrustManager()[0]);
        builder.hostnameVerifier(SSLSocketClient.getHostnameVerifier());
        builder.readTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
        builder.connectTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
        builder.addInterceptor(chain -> {
            Request original = chain.request();
            Request request = original.newBuilder()
                    .header("tenantId", context.getResources().getString(com.mediacloud.app.reslib.R.string.tenantid))
                    .build();
            return chain.proceed(request);
        });
        Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl + "/")
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .client(builder.build())
                .build();
        spiderServerApi = retrofit.create(ISpiderCmsApi.class);
    }

    public static ISpiderCmsApi getSpiderCmsApi(Context context) {
        if (spiderCmsApi == null) {
            synchronized (SpiderCmsApi.class) {
                if (spiderCmsApi == null && context != null) {
                    initSpiderCmsApi(context.getApplicationContext());
                }
            }
        }
        return spiderCmsApi;
    }

    private static void initSpiderCmsApi(Context context) {
        String baseUrl = AppFactoryGlobalConfig.getAppServerConfigInfo(context).spider_cms;
        //开发环境调试 用的固定cms域名哈
        // String baseUrl = "https://api.junhao.chinamcloud.com/cmsbackdev";
        if (TextUtils.isEmpty(baseUrl)) {
            Log.e("DataInvokeUtil", "initSpiderCmsApi failed spider_cms is null");
            return;
        }
        HttpLoggingInterceptor interceptor = new HttpLoggingInterceptor();
        interceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        builder.dns(new MyDns());
        ProxyUtil.config(builder);
        builder.protocols(Collections.unmodifiableList(Arrays.asList(Protocol.HTTP_1_1, Protocol.HTTP_2)));
        builder.addInterceptor(new SignInterceptor());
        builder.addInterceptor(new GETBadInterceptor(AppFactoryGlobalConfig.getAppServerConfigInfo(context).spider_cms, AppFactoryGlobalConfig.getAppServerConfigInfo(context).cdn_spider_cms));
        builder.addInterceptor(interceptor);
        builder.sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), (X509TrustManager) SSLSocketClient.getTrustManager()[0]);
        builder.hostnameVerifier(SSLSocketClient.getHostnameVerifier());
        builder.readTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
        builder.connectTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
        builder.addInterceptor(chain -> {
            Request original = chain.request();
            Request request = original.newBuilder()
                    .header("tenantId", context.getResources().getString(com.mediacloud.app.reslib.R.string.tenantid))
                    .build();
            return chain.proceed(request);
        });
        Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl + "/")
                .addConverterFactory(GsonConverterFactory.create())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .client(builder.build())
                .build();
        spiderCmsApi = retrofit.create(ISpiderCmsApi.class);
    }

    public static ISpiderCmsApi getSpiderCmsApiJson(Context context) {
        if (spiderCmsApiJson == null) {
            synchronized (SpiderCmsApi.class) {
                if (spiderCmsApiJson == null) {
                    initSpiderCmsApiJson(context.getApplicationContext());
                }
            }
        }
        return spiderCmsApiJson;
    }

    private static void initSpiderCmsApiJson(Context context) {
        String baseUrl = AppFactoryGlobalConfig.getAppServerConfigInfo(context).spider_cms;
        //开发环境调试 用的固定cms域名哈
        //       String baseUrl = "https://api.junhao.chinamcloud.com/cmsbackdev";
        if (TextUtils.isEmpty(baseUrl)) {
            Log.e("DataInvokeUtil", "initSpiderCmsApiJson failed spider_cms is null");
            return;
        }
        OkHttpClient.Builder builder = new OkHttpClient.Builder();
        builder.addInterceptor(new SignInterceptor());
        builder.addInterceptor(new GETBadInterceptor(AppFactoryGlobalConfig.getAppServerConfigInfo(context).spider_cms, AppFactoryGlobalConfig.getAppServerConfigInfo(context).cdn_spider_cms));
        HttpLoggingInterceptor loggingInterceptor = new HttpLoggingInterceptor();
        loggingInterceptor.setLevel(HttpLoggingInterceptor.Level.BODY);
        builder.addInterceptor(loggingInterceptor);
        builder.sslSocketFactory(SSLSocketClient.getSSLSocketFactory(), (X509TrustManager) SSLSocketClient.getTrustManager()[0]);
        builder.hostnameVerifier(SSLSocketClient.getHostnameVerifier());
        builder.readTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
        builder.connectTimeout(HTTPClient.TIME_OUT, TimeUnit.SECONDS);
        ProxyUtil.config(builder);
        builder.addInterceptor(chain -> {
            Request original = chain.request();
            Request request = original.newBuilder()
                    .header("tenantId", context.getResources().getString(com.mediacloud.app.reslib.R.string.tenantid))
                    .build();
            return chain.proceed(request);
        });
        Retrofit retrofit = new Retrofit.Builder().baseUrl(baseUrl + "/")
                .addConverterFactory(new JSONObjectConvertFactory())
                .addCallAdapterFactory(RxJava2CallAdapterFactory.create())
                .client(builder.build())
                .build();
        spiderCmsApiJson = retrofit.create(ISpiderCmsApi.class);
    }

    public interface ISpiderCmsApi {

        @Multipart
        @POST("api/politics/uploadImages")
        Call<PoliticsSubmitImageReturnData> uploadImages(@PartMap Map<String, RequestBody> map, @Part List<MultipartBody.Part> parts, @Header("tenantId") String tenantId);

        /**
         * APP端发起微直播申请
         */
        @POST("api/liveAudit/save")
        Call<BaseDataBean<String>> liveAuditSave(@Body RequestBody body, @Header("tenantId") String tenantId);

        @Multipart
        @POST("api/image/uploadImage")
        Call<BaseDataBean<UploadImageData>> uploadImage(@Part MultipartBody.Part body, @Header("tenantId") String tenantId);

        @GET("api/micro/live/article/findPage")
        Call<HeBeiLiveImageTextListData> getLiveArticleList(@QueryMap Map<String, Object> body);


        @POST("api/liveAudit/findPage")
        Call<BaseDataListBean<LiveAuditMod>> getLiveAuditFindPage(@Body RequestBody body, @Header("tenantId") String tenantId);

        @GET("api/liveAudit/getLiveAuditById/{id}")
        Call<BaseDataBean<LiveAuditMod>> getLiveAuditById(@Path("id") String id, @Header("tenantId") String tenantId);

        //删除微直播申请
        @POST("api/liveAudit/batchDelete")
        Call<BaseDataBean<String>> batchDelete(@Body RequestBody body, @Header("tenantId") String tenantId);

        @GET("api/comment/findMicroCommentList")
        Call<BaseDataListBean<MSG_Comment>> getCommentList(@QueryMap Map<String, Object> body, @Header("tenantId") String tenantId);

        @GET("api/micro/live/seat/live")
        Call<HeBeiLiveDetail> getLiveDetail(@Query("articleId") String articleId);

        @POST("api/micro/live/seat/findPage")
        Call<MircoLiveSeat> getLiveSeat(@Body RequestBody body);

        @POST("api/audience/heartCheck")
        Call<HeartCheckData> heartCheck(@Body RequestBody body);

        @GET("api/micro/live/seat/live")
        Observable<HeBeiLiveDetail> getLiveDetail2(@Query("articleId") String articleId);

        @GET("api/micro/live/seat/findPage")
        Observable<MircoLiveSeat> getLiveSeat2(@QueryMap Map<String, Object> body);


        @POST("api/tipoff/findShortVideoList")
        Observable<SearchTiktokData> findShortVideoList(@Header("tenantId") String tenantId, @Body RequestBody body);

        @POST("api/tipoff/save")
        Observable<JSONObject> getShangBao(@Header("tenantId") String tenantId, @Body RequestBody body);

        /**
         * 获取剧集详情
         */
        @GET("api/article/getSeriseArticleDetail")
        Call<DramaDetailResponse> getDramaDetail(@Query("articleId") String articleId, @Header("tenantId") String tenantId);

        /**
         * 获取剧集推荐列表
         */
        @GET("api/article/getRecommendPageList")
        Call<DramaListResponse> getRecommendPageList(@QueryMap() HashMap<String, String> map, @Header("tenantId") String tenantId);

        @GET("api/series/getSeriesType")
        Observable<CategoryData> getCategory(@Header("tenantId") String tenantId, @QueryMap Map<String, Object> map);

        @GET("api/article/findSeriesPageForApp")
        Observable<JSONObject> findSeriesPageForApp(@Header("tenantId") String tenantId, @QueryMap Map<String, Object> map);

        /**
         * 举报类型
         *
         * @param tenantId
         * @return
         */
        @GET("api/reportType/listAllOnlineTypes")
        Observable<JSONObject> reportList(@Header("tenantId") String tenantId);

        /**
         * 举报类型
         *
         * @param tenantId
         * @return
         */
        @GET("api/praise/getPraiseList")
        Observable<JSONObject> getPraiseList(@Header("tenantId") String tenantId, @QueryMap Map<String, Object> map);

        /*
         * 应急知识列表
         * */
        @GET("/api/content/list")
        Observable<JSONObject> yinjizhishiList(@Header("tenantId") String tenantId, @Query("page") int page, @Query("perPage") int perPage);

        /**
         * 新增举报内容
         */
        @POST("api/reportContent/save")
        Call<BaseDataBean<String>> saveReportSeason(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 新增爆料
         */
        @POST("api/tipoff/save")
        Call<BaseDataBean<String>> NewDisclosure(@Body RequestBody body, @Header("tenantId") String tenantId);


        /**
         * 获取节目单
         */
        @POST("api/live/liveShowSet/findNoPage")
        Call<ProgramNew> getProgramList(@Body RequestBody body);

        /**
         * 分页获取热门榜单列表
         *
         * @return
         */
        @GET("api/spiderHotarticle/getSpiderHotArticle")
        Call<BaseDataListBean<MediaListBean>> getSpiderHotArticle(@Query("type") String type, @Query("pageNumber") int pageNumber, @Query("pageSize") int pageSize, @Header("tenantId") String tenantId);

        /**
         * 剧集获取 查询所有显示（未隐藏）的分类
         */
        @GET("api/seriesAlbumType/listAllShowTypes")
        Call<MovieCategoryDataBean> getListAllShowTypes();

        /**
         * 通过专辑内容关联类型分页搜索专辑
         *
         * @param tenantId
         * @param map
         * @return
         */
        // @GET("api/article/findSeriesVideoAlbumPage")
        @GET("api/videoAlbum/findAlbumArticlePage")
        Observable<JSONObject> findSeriesVideoAlbumPage(@Header("tenantId") String tenantId, @QueryMap Map<String, Object> map);


        /**
         * 根据文稿ID获取音视频合集详情
         *
         * @param id
         * @return
         */
        @GET("api/album/getAlbumArticleDetail")
        Call<BaseDataBean<AlbumDetail>> getAlbumArticleDetail(@Query("articleId") String id);


        /**
         * 获取合集下所有已发布单集
         *
         * @param albumId
         * @return
         */
        @GET("api/album/findAllPublishArticles")
        Call<BaseDataBean<List<AlbumDetail>>> findAllPublishArticles(@Query("albumId") String albumId);

        /**
         * 获取合集下所有已发布单集   分页
         */
        @GET("api/album/findPublishArticlePage")
        Call<PublishArticlePage> findPublishArticlePage(@Query("id") String albumId, @Query("pageNumber") int pageNumber, @Query("pageSize") int pageSize,@Query("orderDirection")String orderDirection,@Query("orderField") String orderField);

        /**
         * 通过文稿ID查询所有相关推荐
         *
         * @param id
         * @return
         */
        @GET("api/seriesRecommend/getByArticleId")
        Call<BaseDataBean<List<AlbumRecommend>>> getSeriesRecommendByArticleId(@Query("articleId") String id);


        /**
         * 分页查询音视频已发布单集文稿
         */
        @POST("api/album/findPublishArticlePage")
        Call<BaseDataListBean<AlbumDetail>> getSeriesRecommendByArticleId(@Body RequestBody body);


        /**
         * 通过父专辑id获取所有专辑
         */
        // @GET("api/article/getSeriesAlbumArticleDetail")
        @GET("api/videoAlbum/getAlbumArticleDetail")
        Call<DramaMainBeanNew> sendSeriesAlbumArticleDetail(@Query("articleId") String id, @Header("tenantId") String tenantId);

        /**
         * 分页查询视频专辑第一级子专辑已发布单集
         * pageNumber	是	Integer	页码
         * pageSize	是	Integer	每页显示数量
         * id	是	Long	专辑id
         */
        @GET("api/videoAlbum/findFirstChildArticlePage")
        Call<BaseDataListBean<VideoAlbumNew>> findFirstChildArticlePage(@Query("id") String id, @Query("pageNumber") int pageNumber, @Query("pageSize") int pageSize,@Query("orderDirection")String orderDirection,@Query("orderField") String orderField);

        /**
         * 分页获取强军号本地榜单列表
         *
         * @return
         */
        @GET("api/article/getHotArticleRankListByCityName")
        Call<BaseDataListBean<MediaListBean>> getSpiderHotArticleByCity(@Query("cityName") String cityName, @Query("size") int pageNumber, @Header("tenantId") String tenantId);

        /**
         * 直播装修详情
         *
         * @param articleId
         * @param tenantId
         * @return
         */
        @GET("api/microlive/getLiveDressDetail")
        Call<BaseDataBean<LiveDressDetail>> getLiveDressDetail(@Query("articleId") String articleId, @Header("tenantId") String tenantId);

        /**
         * 直播推荐页面往期内容
         *
         * @param body
         * @return
         */
        @POST("api/microlive/findLiveHistory")
        Call<BaseDataListBean<LiveHistory>> getLiveHistory(@Body RequestBody body);

        /**
         * 直播间统计数据
         */
        @GET("api/microlive/getLiveStatistics")
        Call<BaseDataBean<LiveStatistics>> getLiveStatistics(@Query("articleId") String articleId);

        /**
         * 删除 动态/帖子
         */
        @POST("api/circleDynamic/delete/{id}")
        Call<BaseDataBean<String>> deleteDongTai(@Body RequestBody body, @Path("id") long id, @Header("tenantId") String tenantId);

        /**
         * 动态详情页
         */
        @GET("api/circleDynamic/getCircleDynamicById/{id}")
        Call<BaseDataBean<DongTaiBean>> getDongtaiDetail(@Path("id") long id, @Header("tenantId") String tenantId);

        /**
         * 发布话题动态
         */
        @POST("api/circleDynamic/save")
        Call<BaseDataBean<String>> submitDongTai(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 动态隐私性设置 公开、私有
         */
        @POST("api/circleDynamic/privacySet")
        Call<BaseDataBean<String>> modifyDongTaiPublic(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 获取最新动态列表(全部话题)
         * 获取最新动态列表(单个话题话题)
         * 动态搜索
         * 获取关注用户的动态列表
         */
        @POST("api/circleDynamic/findPage")
        Call<BaseDataListBean<DongTaiBean>> getAllDongTaiList(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 动态 - 查询热门动态
         */
        @GET("api/circleDynamic/pageHot")
        Call<BaseDataListBean<DongTaiBean>> getHotDongTaiListForHuati(@QueryMap Map<String, Object> map);

        /**
         * 动态 - 查询最新动态
         */
        @GET("api/circleDynamic/pageNewest")
        Call<BaseDataListBean<DongTaiBean>> getNewDongTaiListForHuati(@QueryMap Map<String, Object> map);

        /**
         * 动态 - 查询榜单动态
         */
        @GET("api/circleDynamic/pageRanking")
        Call<BaseDataListBean<DongTaiBean>> getRankingDongTaiListForHuati(@QueryMap Map<String, Object> map);

        /**
         * 话题 - 成员活跃度排行榜
         */
        @GET("api/circleTopic/ranking/memberActivation")
        Call<BaseDataBean<ActivationRankingBean>> getActivationRankingListForHuati(@Query("topicId") long topicId);

        /**
         * 我的作品
         */
        @POST("api/circleDynamic/personalHomePage")
        Call<BaseDataListBean<DongTaiBean>> getAuthorDongTaiList(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 圈子首页/圈子搜索 推荐话题列表
         *
         * @param tenantId
         * @return
         */
        @GET("api/circleTopic/getRecommendTopics")
        Call<BaseDataBean<List<HuaTiBean>>> getTuiJianHuaTiList(@Header("tenantId") String tenantId);

        /**
         * 获取最新话题列表
         * 获取最热话题列表
         * 话题搜索
         * 获取推荐话题列表
         */
        @POST("api/circleTopic/findPage")
        Call<BaseDataListBean<HuaTiBean>> getHuaTiList(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 话题 - 查询话题广场
         */
        @GET("api/circleTopic/ground")
        Call<BaseDataBean<List<PlaygroundGatherBean>>> getPlaygroundGatherList();

        /**
         * 查询评论回复分页（我的圈子主页 回复列表）
         *
         * @param map userId（是）,pageNumber（否）,  pageSize（否）
         */
        @GET("api/comment/getMyCircleDynamicCommentsReplies")
        Call<BaseDataListBean<UserHomeHuiFu>> getUserHomeReplyList(@QueryMap Map<String, Object> map, @Header("tenantId") String tenantId);

        /**
         * 赞过的动态列表
         */
        @GET("api/circleDynamic/getMyPraisedDynamicPage")
        Call<BaseDataListBean<DongTaiBean>> getMyPraisedDongTaiList(@QueryMap Map<String, Object> map, @Header("tenantId") String tenantId);

        /**
         * 话题榜单首页（头部背景）
         */
        @GET("api/circleTopic/getTopicBanner")
        Call<BaseDataBean<String>> getHuaTiBangDanTopBg(@Header("tenantId") String tenantId);


        /**
         * 获取动态点赞用户列表
         */
        @POST("api/praise/praiseUserPage")
        Call<BaseDataListBean<PraiseUserInfo>> getPraiseListForArticleId(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 话题关注与取消
         */
        @POST("api/follow/saveFollow")
        Call<BaseDataBean<String>> followHuaTi(@Body RequestBody body, @Header("tenantId") String tenantId);

        /**
         * 话题详情页
         */
        @GET("api/circleTopic/{id}")
        Call<BaseDataBean<HuaTiBean>> getHuaTiDetail(@Path("id") long id, @Header("tenantId") String tenantId);

        /*
         *  应急广播上报
         * */
  /*      @POST("api/tipoff/save")
        Call<JSONObject> getBaoLiao(@Body RequestBody body, @Header("tenantId") String tenantId);
*/

        /**
         * 获取推荐视频动态列表
         */
        @POST("api/circleDynamic/recommendVideoDynamic")
        Call<BaseDataListBean<DongTaiBean>> getVideoDongTaiList(@Body RequestBody body, @Header("tenantId") String tenantId);

        // 获取点赞状态
        @POST("api/praise/isLike")
        Call<BaseDataBean<JsonObject>> isLike(@Body RequestBody body);

        @GET("api/reportType/listAllOnlineTypes")
        Call<BaseDataBean<JsonObject>> getReportReasonItem();

        @GET("api/microlive/findAdvertmentList")
        Call<BaseDataListBean<LiveAD>> getLiveADList(@QueryMap Map<String, Object> body);

        @GET("api/microlive/findAdvertmentList")
        Observable<BaseDataListBean<LiveAD>> getLiveADList2(@QueryMap Map<String, Object> body);

        @GET("api/microlive/getRoomUserInfo")
        Call<BaseDataBean<LiveUserInfo>> getRoomUserInfo(@Query("articleId") long articleId, @Query("userId") String userId);

        @POST("api/microlive/online")
        Call<BaseDataBean<LiveUserInfo>> liveOnline(@Body RequestBody body);

        @POST("api/microlive/offline")
        Call<BaseDataBean<Boolean>> liveOffline(@Body RequestBody body);

        @GET("api/micro/live/seat/supplements")
        Observable<JSONObject> getRoomSupplements(@Query("articleId") long articleId, @Query("userId") String userId);

        @POST("api/ebook/findEbookList")
        Call<BaseDataListBean<EbookData>> getEbookList(@Body RequestBody body);


        @GET("api/ebook/getEbookDetail")
        Call<BaseDataBean<EbookMode>> getEbookDetail(@Query("id") String id, @Header("tenantId") String tenantId);

        @FormUrlEncoded
        @POST("api/hitCount/addHitCount")
        Call<BaseDataBean<AddBookReadBean>> addHitCount(@FieldMap Map<String, String> map, @Header("tenantId") String tenantId);

        @POST("api/ebook/addMark")
        Observable<JSONObject> addMark(@Body RequestBody body);

        @POST("api/ebook/newsMarkList")
        Observable<JSONObject> newsMarkList(@Body RequestBody body);

        @GET("api/ebook/deleteMark")
        Observable<JSONObject> deleteMark(@QueryMap Map<String, String> map);


        @POST("api/ebook/newsNoteList")
        Observable<JSONObject> newsNoteList(@Body RequestBody body);

        @GET("api/ebook/deleteNote")
        Observable<JSONObject> deleteNote(@QueryMap Map<String, String> map);


        @POST("api/ebook/editNote")
        Observable<JSONObject> editNote(@Body RequestBody body);

        @POST("api/ebook/addNote")
        Observable<JSONObject> addNote(@Body RequestBody body);

        /**
         * 获取加入的话题
         */
        @GET("api/circleTopic/pageUserFollowed")
        Observable<JSONObject> getJoinTopic(@Query("userId") String userId);

        /**
         * 获取活跃榜单
         */
        @GET("api/circleTopic/ranking/memberActivation")
        Observable<JSONObject> getCharts(@Query("topicId") String topicId);

        /**
         * 获取创作榜单
         */
        @GET("api/circleTopic/ranking/postCount")
        Observable<JSONObject> getCharts2(@Query("topicId") String topicId);

        /**
         * 分页获取百科榜单
         */
        @GET("api/wikiRanking/findPage")
        Call<BaseDataListBean<WikiRankList>> getWikiRanking(@Query("pageNumber") int pageNumber, @Query("pageSize") int pageSize, @Query("rankingType") int rankingType);

        /**
         * 话题 - 获取话题权限信息
         * userId	否	long	用户ID，可选，指定此参数时查询用户缺失的权限
         * topicIds	是	string	话题ID，多个时使用,分割
         *
         * @return
         */
        @GET("api/circleTopic/authorities")
        Observable<JSONObject> getTopicAuthorities(@Query("userId") String userId, @Query("topicIds") String topicIds);

        /**
         * 话题 - 用户是否关注
         * userId	是	long	用户ID
         * topicIds	是	string	话题ID，多个时用,分割
         *
         * @return
         */
        @GET("api/circleTopic/userFollowed")
        Call<BaseDataBean<List<String>>> getTopicFollowList(@Query("userId") String userId, @Query("topicIds") String topicIds);

        /**
         * 动态 - 搜索(注：替换原搜索动态的接口)
         * pageSize	是	Integer	单页数据量
         * pageNumber	是	Integer	当前页码
         * keyword	是	String	搜索关键词
         */
        @GET("api/circleDynamic/search")
        Call<BaseDataListBean<DongTaiBean>> getSearchCircleDynamicList(@Query("keyword") String keyword,
                                                                       @Query("pageNumber") String pageNumber,
                                                                       @Query("pageSize") String pageSize, @Header("tenantId") String tenantId);

        /**
         * 投票 - 用户投票状态
         * userId	是	long	用户ID
         * circleIds	是	string	投票动态ID，多个时使用,进行分割
         *
         * @return
         */
        @GET("api/circle/vote/userVote")
        Call<BaseDataBean<HashMap<String, String>>> getCircleVoteList(@Query("userId") String userId, @Query("circleIds") String circleIds);

        //获取精选推荐
        @GET("api/article/findSimpleArticleByAuthors")
        Call<PopularRecommendBean> getPopularReCommend(@Query("authorIds") String authorIds, @Header("tenantId") String tenantId);

        //获取精选推荐带页码
        @GET("api/article/findSimpleArticleByAuthors")
        Call<PopularRecommendBean> getPopularReCommend(@Query("authorIds") String authorIds, @Query("pageNumber") long pageNumber, @Query("pageSize") long pageSize, @Header("tenantId") String tenantId);

        //创建电台主播接口 spiderserver
        @POST("community/communityReporter/client/create")
        Call<BaseDataBean<String>> createReporter(@Header("access_token") String access_token, @Body RequestBody body);

        //会员认证列表查询接口 spiderserver
        @GET("community/communityReporter/client/list")
        Call<CommunityReporterList> getCommunityReporterList(@Header("access_token") String access_token, @Query("access_token") String access_token1, @Query("memberId") String memberId);

        //客户端 - 通讯员军事单位选项 spiderserver
        @GET("community/communityReporter/client/militarySelections")
        Call<MilitarySelections> militarySelections(@Header("access_token") String access_token, @Query("access_token") String access_token1);

        //达人榜查询接口 spiderserver
        @GET("community/communityReporter/client/anchorHeatRankList")
        Call<AnchorHeatRankList> anchorHeatRankList(@Query("rank") int rank);

        /**
         * types 榜单类型,多个用,分隔，1-热门榜，2-热歌榜
         * 达人榜查询接口 cms
         */
        @GET("api/radioRank/findList")
        Call<RadioRankFindList> radioRankFindList(@Query("tenantId") String tenantId, @Query("limitCount") int limitCount, @Query("types") int types);

        /**
         * 增加播放时长
         */
        @POST("api/radioRank/addPlayDuration")
        Call<BaseBeen> addPlayDuration(@Header("access_token") String access_token, @Body RequestBody body);

        /**
         * 获取父杂志栏目、子杂志栏目、子杂志栏目下稿件列表
         *
         * @param fatherId   父杂志栏目id
         * @param pageNumber 页码 默认1
         * @param pageSize   文稿每页条数 默认10
         * @return
         */
        @GET("api/article/getChildMagazinePage")
        Observable<JSONObject> getChildMagazineList(@Query("fatherId") String fatherId, @Query("pageNumber") int pageNumber, @Query("pageSize") int pageSize);

        /**
         * 获取杂志期刊年份列表
         *
         * @param periodicalId 期刊id
         * @return
         */
        @GET("api/magazine/listAllYears")
        Observable<JSONObject> getMagazineReviewList(@Query("periodicalId") Long periodicalId);

        /**
         * 通过年份获取期刊列表
         *
         * @param periodicalId 期刊id
         * @return
         */
        @GET("api/magazine/getPeriodicalByYear")
        Observable<JSONObject> getMagazineReviewList(@Query("periodicalId") Long periodicalId, @Query("year") String year);


        /**
         * 获取爆料栏目
         */
//        @Headers("Content-type:application/json;charset=UTF-8")
        @GET("api/tipoff/getTipoffCatalog")
        Call<JSONObject> getRevelationCatalogList(@Header("tenantId") String tenantId, @Query("appId") String appId);

        /**
         * 提交爆料
         *
         * @return
         */
        @POST("api/tipoff/saveOrUpdateJH")
        Call<SubmitRevelationReturnData> addRevelation(@Header("tenantId") String tenantId, @Body RequestBody body);

        /**
         * 获取我的爆料列表
         */
        @POST("api/tipoff/findPage")
        Observable<NewBaoLiaoListModel> getTipoffFindPageList(@Header("tenantId") String tenantId, @Body RequestBody body);

        /**
         * 获取爆料发布次数
         */
        @GET("api/tipoff/getSubmitTipoffCount")
        Observable<NewBaoLiaoCountModel> getSubmitTipoffCount(@Query("tenantId") String tenantId, @Query("tipoffTypeId") long tipoffTypeId, @Query("userId") String userId);


        /**
         * 新闻联播获取新闻及拆条栏目稿件（安徽）
         */
        @GET("api/article/findNewsCastByDatePageV2")
        Call<BaseDataListBean<SimulcastBean>> findNewsCastByDatePage(@QueryMap Map<String,Object> map);
        /**
         * 获取指定日期新闻联播栏目稿件及拆条栏目稿件（安徽）
         */
        @GET("api/article/getNewsCastByDateV2")
        Call<BaseDataBean<SimulcastBean>> getNewsCastByDate(@Query("catalogId")String catalogId, @Query("firstCatalogId")String firstCatalogId,
                                                                 @Query("secondCatalogId")String secondCatalogId, @Query("searchDate")String searchDate);

        /**
         * 获取新闻联播日期（安徽）
         */
        @GET("api/article/getCatalogDate")
        Call<BaseDataBean<List<DateBean>>> getCatalogDate(@Query("catalogId") String catalogId, @Query("startTime") String startTime, @Query("endTime") String endTime);


        /**
         * 获取指定栏目当天最新直播状态
         */
        @GET("api/micro/live/seat/todayLiveStatus")
        Call<BaseDataBean<CCTVLiveStatus>> getCCTVLiveStatus(@Query("catalogId") String catalogId);

        /**
         * 获取指定栏目当天最新直播
         */
        @GET("api/micro/live/seat/todayLive")
        Call<BaseDataBean<TodayCCTVNews>> getTodayCCTVNews(@Query("catalogId") String catalogId);

        /**
         * 声明详情
         * */
        @GET("api/statement/getByType")
        Call<BaseDataBean<MessageStatementBean>> getByType(@Query("type") int type);

        @POST("api/praise/findPressInfoPage")
        Call<BaseDataListBean<MyMsgCollectBean>> getMyMsgCollectList(@Body RequestBody body);

        @POST("api/contributionArticle/findPage")
        Call<BaseDataListBean<ArticleBean>> getArticleList(@Body RequestBody body);

        @POST("api/contributionArticle/cleanDraft")
        Call<BaseDataBean<String>> clearDraft(@Body RequestBody body);

        @POST("api/contributionArticle/deleteByArticleIds")
        Call<BaseDataBean<String>> deleteByArticleIds(@Body RequestBody body);
        /**
         * 查询所有已发布话题 :1-留言话题；2-投稿库话题；
         * */
        @GET("api/interactionTopic/listAllPublish")
        Call<BaseDataBean<List<MessageTypeItem>>> getContributeTopics(@Query("type") int type);

        /**
         * 添加/更新稿件(https://showdoc.chinamcloud.com/web/#/10?page_id=36712)
         * */
        @POST("api/contributionArticle/saveOrUpdate")
        Call<BaseDataBean<String>> saveOrUpdate(@Body RequestBody body);

        @GET("api/contributionArticle/getDetail")
        Call<BaseDataBean<ContributeDetail>> getContributeDetail(@Query("articleId") Long articleId);

        @GET("api/micro/live/seat/getTimeShiftTemplates")
        Call<BaseDataBean<JSONObject>> getTimeShiftTemplates();

    }
}
